 function getQueryString(name){
            var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
            var r = decodeURI(window.location.search).substr(1).match(reg);
            if(r!=null)return  unescape(r[2]); return null;
        }
        var city = getQueryString('city');
        //alert(city);
        if(city == null){
            $('#weather').html('Error');
        }
		$.ajax({
			url: 'http://op.juhe.cn/onebox/weather/query?cityname='+city+'&key=346fbf3dd1ee31151d025903f67267b8',
            async: false,
			type: 'GET',
			dataType: 'JSONP',
			success: function(data){
                console.log(data);
                var str = '天气预报 ';
                data = data.result.data;
                var realtime = data.realtime;
                var life = data.life;
                var weather = data.weather;
                var pm = data.pm25.pm25;
                str +=realtime.city_name+','+realtime.date+' 今天：'+weather[0].info.night[2]+'~'+weather[0].info.day[2]+'℃, '+weather[0].info.day[1]
                    +', 明天：'+weather[1].info.night[2]+'~'+weather[1].info.day[2]+'℃, '+weather[1].info.day[1]+'; '
                    +life.info.chuanyi[0]+', '+life.info.chuanyi[1]+' PM2.5：质量'+pm.quality+', '+pm.des;
			    $("#weather").html(str);
			}
		});